home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Question about C compiler
- Date: 16 Apr 1996 20:51 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <16APR199620514504@erich.triumf.ca>
- References: <1996Apr16.175344.6042@lafn.org>
- NNTP-Posting-Host: erich.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <1996Apr16.175344.6042@lafn.org>, av871@lafn.org (Karl Chen) writes...
- >
- > In C and C++ ,there is a way to allocate and dealloacte memory
- >dynamically ( in C,using malloc() and free(),In C++,using new and delete)
- >..I heard from a book that some compiler do not delete the pointer after
- >deallocation,is this true?Why they don't do this ? What about Boland C++
- >? Can anyone give me a advice ?
-
- free(ptr) does not change ptr, or the memory ptr points to - it just "marks"
- the memory as available for future malloc()s.
-
- After you do free(ptr) you can (but shouldn't) access the "freed" memory,
- and the data previously stored in it, providing a later malloc() has not used
- the space.
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
- or: http:://vancouver-webpages.com/peter/index.html
-
-